Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Added code to support Singularity on HiperGator #389

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

suhasthegame
Copy link

No description provided.

logger.info(f'Job {jobid} was cancelled by user.')
return JOB_STATUS.CANCELLED

time.sleep(5) # Sleep to avoid busy waiting
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be better to call s.wait(5) and catch ExitTimeoutException.

bind_paths[temporary_directory] = '/output'
super().__call__(*args,**kwargs)

qos = kwargs.pop('qos', 'pinaki.sarder')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend having these from environment variables. And, rather than construct the slurm script ourselves, we could use the simple_slurm package to do it (it does the same thing, but has been validated by others and escapes command line parameters appropriately).

bind_option = ','.join([f"{host}:{container}" for host, container in bind_paths.items()])

# Construct the Singularity command
singularity_command = f'singularity exec --bind {bind_option} docker://{image} {" ".join(container_args)}'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The join is unsafe -- if the container args contain spaces or quotes or shell characters, odd things will happen.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants